import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pretty_qr_code/pretty_qr_code.dart';

class ShowQRCode extends Dialog {
  String showData;
  ShowQRCode({Key? key, required this.showData}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new Material(
      //创建透明层
      type: MaterialType.transparency, //透明类型
      child: Center(
        child: SizedBox(
          width: ScreenUtil().setWidth(500),
          height: ScreenUtil().setHeight(660),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text(
                '请对我的服务做出评价，谢谢',
                style: TextStyle(color: Colors.white),
              ),
              SizedBox(
                width: ScreenUtil().setWidth(300),
                child: PrettyQrView.data(
                  data: showData ?? '',
                  // decoration: const PrettyQrDecoration(
                  //   image: PrettyQrDecorationImage(
                  //     image: AssetImage('images/flutter.png'),
                  //   ),
                ),
              ),
              Container(
                width: 200,
                height: ScreenUtil().setHeight(80),
                color: Colors.white,
                child: TextButton(
                    onPressed: () {
                      Navigator.pop(context);
                    },
                    child: Text('关闭')),
              )
            ],
          ),
        ),
      ),
    );
  }
}
